#!/usr/bin/env python3

import numpy as np
import h5py

def load_data():
  train_dataset = h5py.File('train_catvnoncat.h5', 'r')
  train_X = np.array(train_dataset['train_set_x'][:])
  train_Y = np.array(train_dataset['train_set_y'][:])

  test_dataset = h5py.File('test_catvnoncat.h5', 'r')
  test_X = np.array(test_dataset['test_set_x'][:])
  test_Y = np.array(test_dataset['test_set_y'][:])

  classes = np.array(test_dataset['list_classes'][:])

  train_Y = train_Y.reshape((-1, 1))
  test_Y = test_Y.reshape((-1, 1))

  return train_X, train_Y, test_X, test_Y, classes

def sigmoid(z):
  return 1/(1 + np.exp(-z))
